{extend name='admin@public/content'}

{block name="content"}
<style>
    .shuxin{
        height: 30px;
        max-width: 120px;
        line-height: 30px;
        padding: 0 10px;
        background: #00bcd4;
        color: #fff;
        font-size: 14px;
        text-align: center;
        margin-left: 10px;
        margin-top: 10px;
    }
    .datasssss{
        display: flex;
        flex-wrap: wrap;
    }
</style>
<form autocomplete="off" onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='form-horizontal layui-form padding-top-20'>
    <div class="form-group">
        <label class="col-sm-2 control-label">拼本名称</label>
        <div class='col-sm-8'>
            <input autofocus name="pname" value='{$vo.pname|default=""}' required="required" title="拼本名称" placeholder="拼本名称" class="layui-input">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">所属商家</label>
        <div class='col-sm-8'>
            <input autofocus name="p_store_id" value="{:widget('Mkg/getMemberName', ['id' => $vo.p_store_id])}" required="required" title="所属商家" placeholder="所属商家" class="layui-input">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">拼本价格(元)</label>
        <div class='col-sm-8'>
            <input type="number" name="pprice" value='{$vo.pprice|default=""}' required="required" title="拼本价格" placeholder="拼本价格" class="layui-input">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">拼本封面图</label>
        <div class='col-sm-8'>

            <div class="col-sm-8 padding-left-0">
                <input style="border-right:none" name="pimage" value="{$vo.pimage|default=''}" class="layui-input" title="请输入链接或上传图片文件" placeholder="请输入链接或上传图片文件">
            </div>
            <div class="col-sm-3 padding-left-0">
                <button data-file="one"  data-field="simage" type="button" class="layui-btn layui-btn-sm" style="height:38px;line-height:38px;width:100%">上传图片文件</button>
            </div>
            <div class="col-sm-1">
                <img src="{$vo.pimage|default=''}" height="60px" width="60px" alt="暂无图片">
            </div>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label label-required">拼本详情图</label>
        <div class='col-sm-8'>
            <table class="layui-table background-item margin-none" lay-size="sm" lay-skin="nob">
                <thead>
                <tr>
                    <td>图片</td>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td class="text-top">
                        <input type="hidden" name="pimagelist" value="{$vo.pimagelist|default=''}">
                        <script>$('[name=pimagelist]').uploadMultipleImage()</script>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">拼本描述</label>
        <div class='col-sm-8'>
            <textarea placeholder="请输入商品描述" title="请输入商品描述" class="layui-textarea" name="pdesc">{$vo.pdesc|default=""}</textarea>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">拼本所需人数</label>
        <div class='col-sm-8'>
            <input type="number" name="p_people_num" value='{$vo.p_people_num|default=""}' required="required" title="拼本所需人数" placeholder="拼本所需人数" class="layui-input">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">分摊价格</label>
        <div class='col-sm-8'>
            <input autofocus name="p_dan_sprice" value='{$vo.p_dan_sprice|default=""}' required="required" title="分摊价格" placeholder="分摊价格" class="layui-input">
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">性别限制</label>
        <div class='col-sm-8'>
            <input autofocus name="p_sex" value='{if condition="$vo.p_sex == 1"}男{elseif condition="$vo.p_sex == 2"}女{else}不限{/if}' required="required" title="性别限制" placeholder="性别限制" class="layui-input">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">拼本属性</label>
        <div class='col-sm-8 datasssss'>
            {volist name="shuxin" id="vo"}
            <div class="shuxin">{$vo}</div>
            {/volist}
        </div>
    </div>







    <div class="hr-line-dashed"></div>

    <div class="col-sm-7 col-sm-offset-2">
        <div class="layui-form-item text-center">
            {if !empty($vo.id)}<input type="hidden" name="id" value="{$vo.id}">{/if}
            <button class="layui-btn" type="submit">保存配置</button>
            <button class="layui-btn layui-btn-danger" type='button' onclick="window.history.back()">取消编辑</button>
        </div>
    </div>

    <script>window.form.render();</script>

    <script>
        /*! 实例富文本编辑器  */
        require(['ckeditor'], function () {
            window.createEditor('[name="content"]', {height: 500});
        });
    </script>
</form>
{/block}